{extend name="../../../view/public/base" /}
{block name="css"}
<style>

    /*.select-test{position: absolute;max-height: 500px;height: 350px;overflow: auto;width: 100%;z-index: 123;display: none;border:1px solid silver;top: 42px;}*/
    /*.layui-show{display: block!important;}*/
    body {
        padding: 20px; background-color: #F2F2F2;
    }
    /*.layui-input-block{*/
    /*height:auto;*/
    /*overflow:visible;*/
    /*text-overflow:inherit;*/
    /*!*text-overflow:none;*!*/
    /*}*/
    .layui-form-pane .layui-form-label {
        font-size: 10px;
    }
    .layui-elip, .layui-form-checkbox span, .layui-form-pane .layui-form-label {
        text-overflow:clip;
        white-space: nowrap;
    }
    /*.layui-input-block .layui-input{*/
    /*display: block;*/
    /*width: 80%;*/
    /*padding-left: 15px;*/
    /*padding-right: 15px;*/
    /*}*/
    /*.layui-tab-item{*/
    /*width: 100%;*/
    /*height: 800px;*/
    /*}*/

    .layui-input, .layui-textarea {
        width: 70%;
    }
    .layui-form-pane .layui-input-block {
        margin-left: 300px;
    }
    .layui-form-pane .layui-form-label {
        width: 300px;
    }
</style>
<link rel="stylesheet" href="/layui/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
<!--<link rel="stylesheet" href="/layui/js/lay-module/upload/cropper/publish.css" media="all">-->

{/block}
{block name="body"}
<form class="layui-form layui-form-pane" id="form">

    <input type="hidden" id="id" name="id" value="{$entity.id? $entity.id : 0}"/>
    <input type="hidden" id="group_id" name="group_id" value="{$group_id? $group_id : 0}"/>
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">组合数据</div>
                <div class="layui-card-body">

                    <br>

                    {volist name="show.config_list" id="config" key="i"}


                    <!--生成表单   start-->
                    {switch name="config.type"}
                    {case value="text"}
                    <!--普通文本框-->

                    {switch name="config.input_type"}
                    {case value="text"}
                    <!--普通文本框-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                <input  type="text" name="{$config.config_name}" onkeyup="JavaScript:replaceLikeVal(this)"
                                        autocomplete="off" placeholder="{$config.info}" class="layui-input"
                                        value="{$config.value? $config.value : null}">
                            </div>
                        </div>



                    </div>
                    <script>

                        layui.use(['jquery','layer'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0, area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                        })

                    </script>


                    {/case}
                    {case value="number"}
                    <!--数字文本框-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                <input  type="number" name="{$config.config_name}"
                                        autocomplete="off" placeholder="{$config.info}" class="layui-input"
                                        oninput = "value=value.replace(/[^\d]/g,'')"
                                        value="{$config.value? $config.value : null}">
                            </div>

                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                        })

                    </script>



                    {/case}
                    {case value="timestamp"}
                    <!--日期-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                <input  type="text" name="{$config.config_name}"
                                        id="time{$config.config_name}"

                                        autocomplete="off" placeholder="{$config.info}" class="layui-input"
                                >
                            </div>
                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer', 'laydate','util'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer
                                ,util = layui.util
                                ,laydate = layui.laydate;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                            //日期时间选择器
                            laydate.render({
                                elem: '#time{$config.config_name}'
                                ,value: new Date(parseInt('{$config.value? $config.value : 0}')*1000)
                                ,isInitValue: true
                                ,type: 'datetime'
                            });
                        })

                    </script>


                    {/case}
                    {case value="color"}
                    <!--颜色选择器-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                <div id="color{$config.config_name}" style="margin-left: 30px;"></div>
                                <input  type="hidden" name="{$config.config_name}"
                                        id="input{$config.config_name}"
                                        value="{$config.value? $config.value : ''}"
                                >
                            </div>
                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer','colorpicker'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer
                                ,colorpicker = layui.colorpicker;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })


                            colorpicker.render({ //无初始色值时
                                elem: '#color{$config.config_name}'
                                ,alpha: true
                                ,format: 'rgb'
                                ,color: "{$config.value? $config.value : '#000'}" //默认值
                                ,done: function(color){
                                    //选色回调
                                    $('#input{$config.config_name}').val(color);
                                }
                            });
                        })

                    </script>




                    {/case}
                    {case value="float"}
                    <!--浮点数-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                <input  type="number" name="{$config.config_name}"
                                        step="0.001"
                                        autocomplete="off" placeholder="{$config.info}" class="layui-input"
                                        value="{$config.value? $config.value : null}">
                            </div>
                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                        })

                    </script>
                    {/case}
                    {/switch}

                    {/case}
                    {case value="textarea"}
                    <!--多行文本框-->

                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                            <textarea placeholder="{$config.info}" class="layui-textarea"
                                                      style="height:{$config.high? $config.high.'%' : 'auto'};width: {$config.width? $config.width.'%' : '100%'};"  onkeyup="JavaScript:replaceLikeVal(this)"

                                                      lay-verify="value" id ='mtext{$config.config_name}'>{$config.value? $config.value : null}</textarea>
                                <input type="hidden" id="mtext_input_{$config.config_name}" name="{$config.config_name}" value="{$config.value? $config.value : null}"/>
                            </div>
                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });

                                //输入框的值改变时触发
                                $("#mtext{$config.config_name}").on("input",function(e){
                                    //获取input输入的值
                                    $('#mtext_input_{$config.config_name}').val(e.delegateTarget.value);
                                });
                            })

                        })

                    </script>

                    {/case}
                    {case value="r_textarea"}
                    <!--富文本框-->


                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                          <textarea placeholder="{$config.info}" class="layui-textarea"
                                                    lay-verify="value" id ='rtext{$config.config_name}'>{$config.value? $config.value : null}</textarea>
                                <input type="hidden" id="rtext_input_{$config.config_name}" name="{$config.config_name}" value="{$config.value? $config.value : null}"/>
                            </div>
                        </div>


                    </div>
                    <script>
                        var layedit_index{$config.config_name};
                        layui.use(['jquery','layer','layedit'],function() {
                            var $ = layui.jquery,
                                layedit = layui.layedit,
                                layer = layui.layer;

                            layedit.set({
                                uploadImage: {
                                    url: "/manage/publicCommon/uploadimg}" //接口url
                                    ,type: 'post' //默认post
                                }
                            });

                            layedit_index{$config.config_name} = layedit.build('rtext{$config.config_name}',{
                                height: parseInt("{$config.high? $config.high : 0 }"), //设置编辑器高度
                                // width: 200
                            }); //建立编辑器

                            setInterval(function(){
                                //console.log(layedit_index);
                                // console.log('{$config.config_name}');
                                // console.log(layedit.getContent(layedit_index));
                                $('#rtext_input_{$config.config_name}').val(layedit.getContent(layedit_index{$config.config_name}));
                            },500);

                            //富文本编辑器改变事件
                            // $('#LAY_layedit_'+layedit_index).contents().find('body').on('DOMNodeInserted', function () {
                            //    // layedit.sync(layedit_index);
                            //     console.log(layedit.getContent(layedit_index));
                            //
                            //
                            // });
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                                //console.log(layedit_index);

                            })

                        })


                    </script>


                    {/case}
                    {case value="radio"}
                    <!--单选框-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                {volist name="config.parameter" id="index"}

                                <input type="radio" name="{$config.config_name}"  value="{$index.value}"  title="{$index.key}" {$config.value==$index.value ?  'checked':'' }  >
                                {/volist}



                            </div>
                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                        })

                    </script>

                    {/case}
                    {case value="checkbox"}
                    <!--复选框-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                {volist name="config.parameter" id="index"}

                                <input type="checkbox" name="{$config.config_name}[]"  value="{$index.value}"  title="{$index.key}" {if condition="strpos($config.value,$index.value)!==false"}checked="" {/if}   >
                                {/volist}



                            </div>
                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                        })

                    </script>

                    {/case}
                    {case value="select"}
                    <!--下拉框-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                <select name="{$config.config_name}"  lay-verify="required" >
                                    {volist name="config.parameter" id="index"}

                                    <option value="{$index.value}"  {$config.value==$index.value ?  'selected':'' }  >{$index.key}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                        })

                    </script>

                    {/case}
                    {case value="upload"}
                    <!--上传-->

                    {switch name="config.upload_type"}
                    {case value="1"}
                    <!--单图-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label required">{$config.info}</label>
                            <div class="layui-input-block layuimini-upload">
                                <input name="{$config.config_name}" class="layui-input layui-col-xs6" lay-verify="required"  placeholder="{$config.desc}" value="{$config.value? $config.value : ''}">
                                <div class="layuimini-upload-btn">
                                    <span><a class="layui-btn" data-upload="{$config.config_name}" data-upload-number="one" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>
                                    <span><a class="layui-btn layui-btn-normal" id="select_{$config.config_name}" data-upload-select="{$config.config_name}" data-upload-number="one" data-upload-mimetype="image/*"><i class="fa fa-list"></i> 选择</a></span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <script>
                        layui.use(['jquery','layer','upload'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer,
                                upload = layui.upload;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })
                        })


                    </script>



                    {/case}
                    {case value="2"}
                    <!--多图-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label required">{$config.info}</label>
                            <div class="layui-input-block layuimini-upload">
                                <input name="{$config.config_name}" class="layui-input layui-col-xs6" lay-verify="required"  placeholder="{$config.desc}" value="{$config.value? $config.value : ''}">
                                <div class="layuimini-upload-btn">
                                    <span><a class="layui-btn" data-upload="{$config.config_name}" data-upload-number="more" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image" data-upload-sign=""><i class="fa fa-upload"></i> 上传</a></span>
                                    <span><a class="layui-btn layui-btn-normal" id="select_{$config.config_name}" data-upload-select="{$config.config_name}" data-upload-number="more" data-upload-mimetype="image/*" data-upload-sign=""><i class="fa fa-list"></i> 选择</a></span>
                                </div>

                                <div></div>
                            </div>
                        </div>
                    </div>


                    <script>
                        layui.use(['jquery','layer','upload'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer,
                                upload = layui.upload;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })
                        })

                    </script>




                    {/case}
                    {case value="3"}
                    <!--文件-->
                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >{$config.info}</label>
                            <div class="layui-input-block" id="{$config.config_name}">
                                <div class="layui-upload">
                                    <input type="hidden" name="{$config.config_name}" id="inputfileurl{$config.config_name}" value="{$config.value? $config.value : ''}" >

                                    {if condition="$config.value!=''&&$config.value!=null"}

                                    &nbsp&nbsp<span  id="uploadfilevent{$config.config_name}" style="color: #4b646f">{$config.files.name}</span>

                                    {else /}

                                    &nbsp&nbsp<span  id="uploadfilevent{$config.config_name}" style="color: #4b646f">未选择文件</span>

                                    {/if}


                                    <button type="button" class="layui-btn layui-btn-normal" id="uploadfileselect{$config.config_name}">选择文件</button>

                                    <button type="button" class="layui-btn" id="uploadfilesend{$config.config_name}">开始上传</button>
                                    <button class="layui-btn layui-btn-danger" type="button" id="deletefile{$config.config_name}">删除文件</button >
                                </div>



                            </div>
                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer','upload'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer,
                                upload = layui.upload;
                            $(function(){
                                var tips;
                                $('#{$config.config_name}').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("{$config.desc}",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                            var uploadfile{$config.config_name};
                            //选完文件后不自动上传
                            upload.render({
                                elem: '#uploadfileselect{$config.config_name}'
                                ,url: "{:Url('/manage/publicCommon/upload',['rule'=>'fileExt:jpg,jpeg,png,gif,pem,sql,txt,html,js,css,php'])}" //改成您自己的上传接口
                                ,auto: false
                                ,accept:'file'//允许上传的文件类型
                                //,multiple: true
                                ,bindAction: '#uploadfilesend{$config.config_name}'
                                ,choose: function(obj){
                                    // this.files =[];
                                    // //将每次选择的文件追加到文件队列
                                    // var files = this.files = obj.pushFile();
                                    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
                                    obj.preview(function(index, file, result){
                                        console.log(index); //得到文件索引
                                        console.log(file); //得到文件对象
                                        console.log(result); //得到文件base64编码，比如图片
                                        $('#uploadfilevent{$config.config_name}').html(file.name);

                                        uploadfile{$config.config_name} = {
                                            name: file.name,//原文件名
                                            size: file.size,//大小
                                            type: file.type,//文件类型
                                        };
                                        //obj.resetFile(index, file, '123.jpg'); //重命名文件名，layui 2.3.0 开始新增

                                        //这里还可以做一些 append 文件列表 DOM 的操作

                                        //obj.upload(index, file); //对上传失败的单个文件重新上传，一般在某个事件中使用
                                        //delete files[index]; //删除列表中对应的文件，一般在某个事件中使用
                                    });
                                }
                                ,done: function(res, index, upload){
                                    //如果上传失败
                                    if(res.data.errcode > 0){
                                        return  layer.msg(res.msg, {
                                            icon: 5,
                                            time: 1000 //1.5秒关闭（如果不配置，默认是3秒）
                                        });
                                    }
                                    //上传成功
                                    uploadfile{$config.config_name}.src = res.data.data.src;
                                    $("#inputfileurl{$config.config_name}").val(JSON.stringify(uploadfile{$config.config_name}));
                                    layer.msg(res.msg, {
                                        icon: 6,
                                        time: 1000 //1.5秒关闭（如果不配置，默认是3秒）
                                    });
                                    return delete this.files[index]; //删除文件队列已经上传成功的文件
                                }
                                ,error: function(){
                                    //演示失败状态，并实现重传
                                    return  layer.msg('上传失败', {
                                        icon: 5,
                                        time: 1000 //1.5秒关闭（如果不配置，默认是3秒）
                                    });
                                }
                            });
                            $('#deletefile{$config.config_name}').on('click', function(){
                                $('#uploadfilevent{$config.config_name}').html('未选择文件');
                                $("#inputfileurl{$config.config_name}").val('');
                            });
                        })

                    </script>

                    {/case}
                    {/switch}


                    {/case}

                    {default /}
                    {/switch}
                    <!--生成表单   end-->
                    <!--<hr class="layui-bg-blue">-->
                    {/volist}

                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >权重</label>
                            <div class="layui-input-block" id="sort">
                                <input  type="number" name="sort"
                                        autocomplete="off" placeholder="权重越高数据越靠前" class="layui-input"
                                        oninput = "value=value.replace(/[^\d]/g,'')"
                                        value="{$entity.sort? $entity.sort : null}">
                            </div>

                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer;
                            $(function(){
                                var tips;
                                $('#sort').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("权重越高数据越靠前",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                        })

                    </script>


                    <div class="layui-form-item">
                        <div class="layui-col-md10">
                            <label class="layui-form-label" >状态</label>
                            <div class="layui-input-block" id="status">
                                {if !empty($entity.status)}
                                <input type="radio" name="status"  value="1"  title="有效"  {$entity.status==1 ? 'checked':'' } >
                                <input type="radio" name="status"  value="2"  title="无效"  {$entity.status==2 ?  'checked':'' }>
                                {else/}
                                <input type="radio" name="status"  value="1"  title="有效" checked >
                                <input type="radio" name="status"  value="2"  title="无效">

                                {/if}
                            </div>

                        </div>


                    </div>
                    <script>

                        layui.use(['jquery','layer'],function() {
                            var $ = layui.jquery,
                                layer = layui.layer;
                            $(function(){
                                var tips;
                                $('#status').on({
                                    mouseenter:function(){
                                        var that = this;
                                        tips =layer.tips("是否是有效数据",that,{tips:[1,'#5FB878'],time:0,area: 'auto'});
                                    },
                                    mouseleave:function(){
                                        layer.close(tips);
                                    }
                                });
                            })

                        })

                    </script>










                </div>
            </div>
        </div>
    </div>








</form>

{/block}

{block name="js"}

<script>

    var table;
    var laydate;
    var	$;
    var form;
    var bwimage;
    var tab_type='text';
    layui.use(['form', 'table','util','laydate','layer','element','bwimage'],function() {
        $ = layui.jquery;
        var util = layui.util,layer = layui.layer ,element = layui.element;
        table = layui.table;
        form = layui.form;
        laydate = layui.laydate;
        bwimage = layui.bwimage;
        form.render();
        bwimage.upload();



    })




    function getId(){
        return $('#id').val();
    }

    function getSaveData(){

        return $('#form').serialize();
    }

    function getIndex(type) {
        var rs=0;
        switch(type) {
            case 'text':
                rs=0;
                break;
            case 'textarea':
                rs=1;
                break;
            case 'r_textarea':
                rs=2;
                break;
            case 'radio':
                rs=3;
                break;
            case 'checkbox':
                rs=4;
                break;
            case 'select':
                rs=5;
                break;
            case 'upload':
                rs=6;
                break;
        }
        return rs;
    }

    function getType(index) {
        var rs='text';
        switch(index) {
            case 0:
                rs='text';
                break;
            case 1:
                rs='textarea';
                break;
            case 2:
                rs='r_textarea';
                break;
            case 3:
                rs='radio';
                break;
            case 4:
                rs='checkbox';
                break;
            case 5:
                rs='select';
                break;
            case 6:
                rs='upload';
                break;
        }
        return rs;
    }

    function HTMLDecode(text)
    {
        var temp = document.createElement("div");
        temp.innerHTML = text;
        var output = temp.innerText || temp.textContent;
        temp = null;
        return output;
    }

    function replaceLikeVal(comp){
        if (comp.value.indexOf("'") != -1 || comp.value.indexOf("\"") != -1) {
            //comp.value = comp.value.substring(0, comp.value.length-1);
            comp.value = comp.value.replace(/\'/g,"").replace(/\"/g,"");
        }
    }

</script>
{/block}